package com.aaa.work1226;


import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.SpringApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;

@SpringBootApplication
@MapperScan("com.aaa.work1226.dao")
public class Work1226Application {

    public static void main(String[] args) {
        SpringApplication.run(Work1226Application.class, args);
    }
//    @Bean
//    public CorsFilter corsFilter() {
//        final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
//        final CorsConfiguration corsConfiguration = new CorsConfiguration();
////        corsConfiguration.setAllowCredentials(true);
//        corsConfiguration.addAllowedHeader("*");// 允许所有的头
//        corsConfiguration.addAllowedOrigin("*");// 允许所有源发出的请求
//        corsConfiguration.addAllowedMethod("*");// 允许所有的方法  GET POST
//        source.registerCorsConfiguration("/**", corsConfiguration);// 所有的路径
//        return new CorsFilter(source);
//    }
}
